package cn.youruan.demo.utils;

import java.util.Calendar;
import java.util.Date;

public class TimeUtil {



    public static Date getLastTime(Date date) {

        Calendar calendar = Calendar.getInstance();

        calendar.setTime(date);

        calendar.set(Calendar.HOUR_OF_DAY,23);
        calendar.set(Calendar.MINUTE,59);
        calendar.set(Calendar.SECOND,59);

        return calendar.getTime();
    }

    public static Long secondToNextDay(Date now,Date lastTime) {
        return Math.abs((lastTime.getTime() - now.getTime())/1000);
    }
}
